/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.statistics;

import com.enation.app.javashop.core.client.feignimpl.statistics.GoodsDataClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import com.enation.app.javashop.model.statistics.dto.GoodsData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fk
 * @version v2.0
 * @Description: 商品收集断路器
 * @date 2018/9/27 14:50
 * @since v7.0.0
 */
@Component
public class GoodsDataClientFallbackFactory extends BaseFallbackFactory<GoodsDataClientFeignImpl> implements FallbackFactory {

    @Override
    protected GoodsDataClientFeignImpl fallback() {
        return new GoodsDataClientFallback();
    }

    /**
     * @author fk
     * @version v2.0
     * @Description: 商品收集断路器
     * @date 2018/9/27 14:50
     * @since v7.0.0
     */
    @Component
    public static class GoodsDataClientFallback implements GoodsDataClientFeignImpl {

        protected final Log logger = LogFactory.getLog(this.getClass());

        @Override
        public void addGoods(Long[] goodsIds) {

            this.logger.error("统计服务异常，添加商品信息异常");

        }

        @Override
        public void updateGoods(Long[] goodsIds) {

            this.logger.error("统计服务异常，更新商品信息异常");

        }

        @Override
        public void deleteGoods(Long[] goodsIds) {

            this.logger.error("统计服务异常，删除商品信息异常");

        }

        @Override
        public void updateCollection(GoodsData goodsData) {

        }

        @Override
        public void underAllGoods(Long sellerId) {

            this.logger.error("统计服务异常，下架商品信息异常");

        }
    }
}
